import time

import pyautogui


#
# # 移动鼠标到(100, 100)位置
# pyautogui.moveTo(100, 100, duration=1)
#
# # 点击鼠标左键
# pyautogui.click()
#
# # 等待1秒
# time.sleep(1)
#
# # 模拟键盘输入
# pyautogui.typewrite("Hello, PyAutoGUI!")
#
# # 截屏保存
# pyautogui.screenshot("screenshot.png")

button_pos = pyautogui.locateOnScreen('微信消息.png')
if button_pos:
    pyautogui.click(button_pos)
else:
    print("Button not found.")